#ifndef __bipartite_h__
#define __bipartite_h__

#include <functional/inttype.h>

typedef struct _bipart_node
{
    struct _bipart_node* parti;
    struct _bipart_node* partii;
    int32 index;
    void* data;
} bipart_node;

typedef struct _bipart
{
    bipart_node* parti;
    bipart_node* partii;
    bipart_node* head;
} bipart;

bipart* bipart_create();
void* bipart_pop( bipart* bp );
void* bipart_popi( bipart* bp );
void* bipart_popii( bipart* bp );
void bipart_pushi( bipart* bp, void* data );
void bipart_pushii( bipart* bp, void* data );
bipart_node* bipart_top( bipart* bp );
bipart_node* bipart_topi( bipart* bp );
bipart_node* bipart_topii( bipart* bp );
void bipart_rmi( bipart *bp, bipart_node *bn );
void bipart_rmii( bipart *bp, bipart_node *bn );
void bipart_destroy( bipart* bp );


#endif // __bipartite_h__
